package com.aabte.springcloudlearn.springcloudstream.sink;

import com.aabte.springcloudlearn.springcloudstream.processor.ProcessorStreamApplication;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.cloud.stream.messaging.Processor;
import org.springframework.cloud.stream.messaging.Sink;

/**
 * @author Daniel
 */
@Slf4j
@EnableBinding(value = {Sink.class})
@SpringBootApplication
public class SinkStreamApplication {

    public static void main(String[] args) {
        SpringApplication.run(SinkStreamApplication.class, args);
    }

    @StreamListener(value = Sink.INPUT)
    public void handler(Object payload){
        log.info("handler received: {}", payload);
    }

}
